import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

/**
 * 查询积分兑换配置列表
 * @param data
 * @returns {*}
 */
export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/exchangeActivity/queryPage',
    method: 'post',
    data
  })
}

/**
 * 更改发布状态
 * @param data
 * @returns {*}
 */
export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeActivity/update',
    method: 'post',
    data
  })
}

/**
 * 查询第一步详情
 * @param {*} id
 */
export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeActivity/get',
    method: 'post',
    data
  })
}

/**
 * 查询第二步详情
 * @param {*} id
 */
export function getSecondFormInfo(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/getByDataId',
    method: 'post',
    data
  })
}

/**
 * 新建、编辑 第二步 提交
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/insert',
    method: 'post',
    data
  })
}

/**
 * 新建、编辑  第一步 提交
 * @param {*} data
 */
export function createOneStep(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeActivity/insert',
    method: 'post',
    data
  })
}

/**
 * 编辑  第一步 提交
 * @param {*} data
 */
export function updateOneStep(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeActivity/update',
    method: 'post',
    data
  })
}

/**
 * 编辑 第二步 提交
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/update',
    method: 'post',
    data
  })
}

/**
 * 人员统计
 * @param {*} data
 */
export function queryRecord(data, url) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: url,
    method: 'post',
    data
  })
}

/**
 * 充值记录列表
 * @param {*} data
 */
export function queryRechargeRecord(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/recharge/getExchangeRecharge',
    method: 'post',
    data
  })
}

/**
 * 兑换统计
 * @param {*} data
 */
export function queryStatistics(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeActivity/getActivityStatistics',
    method: 'post',
    data
  })
}

/**
 * 活动统计详情
 * @param {*} data
 */
export function queryRecordDetail(data, url) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: url,
    method: 'post',
    data
  })
}

/**
 * 删除
 * @param {*} id
 */
export function del(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/goldPool/deleteByIds',
    method: 'get',
    params: { ids }
  })
}

/**
 * 兑换记录导出统计
 */
export function exportFile(data, url) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: url,
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 京东订单记录--导出脱敏
 */
export function exportJdOrderMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/jdActivity/jdOrderExportMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 京东订单记录--导出不脱敏
 */
export function exportJdOrderNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/jdActivity/jdOrderExportNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 兑换记录导出统计--旧
 */
export function exportDetailFile(data, url) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: url,
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 消费明细详情---- 脱敏
 */
export function exportDetailMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/jdOrderExportMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 消费明细详情---- 不脱敏
 */
export function exportDetailNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/jdOrderExportNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}

/**
 * 获取出金账户
 * @param {*} data
 * @returns
 */
export function getAcc(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/account/getExpenditureAccount',
    method: 'post',
    data
  })
}
/* 退款
 */
export function refund(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/refundmentRecord/insertRecord',
    method: 'post',
    data
  })
}

/**
 * 获取用户子账号数据
 * @param {*} data
 * @returns
 */
export function getAccountList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/childAccount/query',
    method: 'post',
    data
  })
}

/**
 * 获取入金账户
 * @param {*} data
 * @returns
 */
export function getInAcc(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/account/queryPage',
    method: 'post',
    data
  })
}

/**
 * 专区列表
 * @param data
 * @returns {*}
 */
export function queryPageByArea(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/exchangeActivity/prefecture',
    method: 'post',
    data
  })
}
/**
 * 退款详情
 * @param {*} data
 */
export function queryRefundDetail(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/huifuOrderRefund/get',
    method: 'post',
    data
  })
}

/**
 * 订单详情
 * @param {*} data
 */
export function queryOrderDetail(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/huifuOrder/get',
    method: 'post',
    data
  })
}
/**
 * 订单详情
 * @param {*} data
 */
export function dataPush(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/huifuOrder/propellingMovementResult',
    method: 'post',
    data
  })
}
// 惠福商城订单脱敏导出
export function exporthfOrderMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/huifuOrder/huiFuOrderExportMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
// 惠福商城订单不脱敏导出
export function exporthfOrderNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/huifuOrder/huiFuOrderExportNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
// 惠福商城退款记录脱敏导出
export function exporthfRefundMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/huifuOrderRefund/huifuOrderRefundExportMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
// 惠福商城退款记录不脱敏导出
export function exporthfRefundNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/huifuOrderRefund/huifuOrderRefundExportNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}

/* 退款详情列表*/
export function infoList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/refundmentRecord/queryPageDetil',
    method: 'post',
    data
  })
}
/* 退款详情导出----脱敏 */
export function infoExportMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/refundmentRecord/exportRefundmentDetilMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/* 退款详情导出----不脱敏 */
export function infoExportNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/refundmentRecord/exportRefundmentDetilNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}

